package my.sample.exception;

import java.util.ArrayList;

public class OutOfMem {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		ArrayList<String> list = new ArrayList<String>();
		int i = 0;
		try {
			while (true) {
				list.add("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
				++i;
			}
		} catch (Exception e) {
			System.out.println(i);
			e.printStackTrace();
		}

	}
}
